Many types of programming languages exist. One form of programming language is a scripting language. A scripting language is a programming language that enables control of one or more applications. A “script”, or program generated according to a scripting language, may be written in a same language or a different language from that of an associated application. While applications are typically first compiled to native machine code, scripts are often interpreted from source code.
Another form of programming language is a dynamic programming language. A dynamic programming language is a programming language that performs some behaviors during runtime that other programming languages (that are not dynamic) may perform during compilation. Such behaviors may include extending a program by adding new code, extending objects and definitions, and/or modifying the type system. Many scripting programming languages are also dynamic programming languages.
A web browser is an application for rendering web pages for display. Scripts are frequently run on web pages in order to dynamically change their content. Client-side scripting generally refers to scripts that are executed client-side by a web browser rather than being executed server-side on a web server. Client-side scripting can make web pages more responsive to user input by avoiding one or more round trip communications with the web server.
Scripts written in dynamic programming languages are difficult to execute efficiently. For instance, JavaScript™ (developed by Mozilla Foundation of Mountain View, Calif.) is an example dynamic programming language used in scripts that is very flexible. In many JavaScript™ programs, only a portion of the JavaScript™ code is executed, and an even smaller portion of the JavaScript™ code is run during the program start-up. As such, parsing of the entire code base unnecessarily delays the start of execution. In addition, most code actually written in JavaScript™ does not exploit the full range of the JavaScript™ language's flexibility. However, the machine code generated by a JavaScript™ compiler is generated to correctly handle a wide spectrum of possibilities at runtime, which results in inefficient execution.